package com.bosssoft.setp.model.business.aliance;

import com.bosssoft.setp.handler.ChoiseFetchHandlerImpl;
import lombok.Getter;
import lombok.Setter;
import xyz.erupt.annotation.Erupt;
import xyz.erupt.annotation.EruptField;
import xyz.erupt.annotation.sub_field.Edit;
import xyz.erupt.annotation.sub_field.EditType;
import xyz.erupt.annotation.sub_field.Readonly;
import xyz.erupt.annotation.sub_field.View;
import xyz.erupt.annotation.sub_field.sub_edit.ChoiceType;
import xyz.erupt.annotation.sub_field.sub_edit.Search;
import xyz.erupt.upms.model.base.HyperModel;

import javax.persistence.*;

/**
 * 加盟商等级参数的类定义
 *
 * @author lin-gaoying
 * @version 1.1
 * @since 1.0
 */
@Erupt(name = "加盟商参数")
@Table(name = "setp_aliance_business_grade_param")
@Entity
@Getter
@Setter
public class AlianceBusinessGradeParam extends HyperModel {

    @EruptField(
            edit = @Edit(title = "加盟商等级ID", readonly = @Readonly(add = true, edit = true))
    )
    private long alianceBusinessGradeId;

    @EruptField(
            views = @View(title = "设备类别"),
            edit = @Edit(
                    search = @Search,
                    title = "状态",
                    type = EditType.CHOICE,
                    choiceType = @ChoiceType(
                            fetchHandler = ChoiseFetchHandlerImpl.class,
                            fetchHandlerParams = {"设备类别"}
                    ))
    )
    private String param;

    @EruptField(
            views = @View(title = "数量"),
            edit = @Edit(title = "数量", notNull = true)
    )
    private Integer value;

}
